package org.flexthinker.binding.value.support
{
    import org.flexthinker.binding.value.*;
    import mx.collections.IList;

    import org.flexthinker.binding.value.support.EqualsValueChangeDetector;
    import org.flexthinker.binding.value.support.ListValueChangeDetector;

    public class ValueChangeDetectorFactory
    {
        public function ValueChangeDetectorFactory()
        {
        }

        public static function getValueChangeDetectorFor( vm:ValueModel ):ValueChangeDetector
        {
            if ( vm.getValue() is IList )
            {
                return new ListValueChangeDetector();
            }
            return new EqualsValueChangeDetector();
        }
    }
}
